<template>
  <div class="department" id="department">
    <!-- 左侧部门管理 -->

    <!-- 右侧 -->
    <div class="department_right">
      <div class="app-container-btn">
        <el-button
          type="primary"
          v-if="btnShow"
          @click="yj_saveForm('formData')"
        >
          保存
        </el-button>

        <el-button @click="goBack">返回</el-button>
      </div>

      <!-- 表格 -->
      <div class="text_table TensionRealTime">
        <div class="dialogBody common table_detail" style="overflow: hidden">
          <div style="overflow-y: auto; margin-bottom: 20px">
            <div class="app-container-area-title">
              <span class="app-container-area-title-divider"></span>
              <span>基本信息</span>
            </div>
            <div>
              <publicForm
                ref="publicForm"
                lableWidth="95px"
                :formObj="formObj"
                :formData="formData"
              >
              </publicForm>
            </div>

            <div v-if="handNum" class="app-container-area-title">
              <span class="app-container-area-title-divider"></span>
              <span>处理情况</span>
            </div>
            <el-collapse v-model="activeNames" @change="changeCollapse">
              <!-- <el-collapse-item name="0" v-if="handNum"> -->
              <el-collapse-item name="0">
                <template slot="title">
                  <div @click.stop="showCollapse()">
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">闭合申请单</span>
                  </div>
                </template>
                <div :style="{ height: handleHeight }">
                  <publicForm
                    ref="publicForm0"
                    lableWidth="95px"
                    :formObj="handleObj"
                    :formData="handleData"
                    :timestamp="handleData.fHandlefile"
                    :fileList="fSourcefileList"
                    @delteFile="delteFile"
                    @inputFocus="inputFocus"
                    @inputBlur="inputBlur"
                    @visibleChange="visibleChange"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>

              <!-- <el-collapse-item name="1" v-if="firstNum"> -->
              <el-collapse-item name="1">
                <template slot="title">
                  <div @click.stop="showCollapse()">
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">一级审核</span>
                  </div>
                </template>
                <div :style="{ height: processHeight }">
                  <publicForm
                    ref="publicForm1"
                    lableWidth="95px"
                    :formObj="processObj"
                    :formData="handleData"
                    @inputFocus="inputFocus"
                    @inputBlur="inputBlur"
                    @visibleChange="visibleChange"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>
              <!-- <el-collapse-item name="2" v-if="secondNum"> -->
              <el-collapse-item name="2">
                <template slot="title">
                  <div @click.stop="showCollapse()">
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">二级审核</span>
                  </div>
                </template>
                <div :style="{ height: examineHeight }">
                  <publicForm
                    ref="publicForm2"
                    lableWidth="95px"
                    :formObj="examineObjs"
                    :formData="handleData"
                    @inputFocus="inputFocus"
                    @inputBlur="inputBlur"
                    @visibleChange="visibleChange"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>

              <!-- <el-collapse-item name="3" v-if="threeLevel"> -->
              <el-collapse-item name="3">
                <template slot="title">
                  <div @click.stop="showCollapse()">
                    <img
                      style="vertical-align: middle"
                      src="@/assets/img/Supervision/com_flg.png"
                      alt=""
                    />
                    <span style="margin-left: 8px">三级审核</span>
                  </div>
                </template>
                <div
                  style="height: 70px; margin-top: 3px"
                  :style="{ height: levelThreeHeight }"
                >
                  <publicForm
                    ref="publicForm3"
                    lableWidth="95px"
                    :formObj="levelThree"
                    :formData="handleData"
                    @inputFocus="inputFocus"
                    @inputBlur="inputBlur"
                    @visibleChange="visibleChange"
                  >
                  </publicForm>
                </div>
              </el-collapse-item>
            </el-collapse>
            <div style="height: 50px"></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
    
<script>
import actions from "@/actions";
import publicForm from "@/components/public/el-form.vue"; //弹框form
import formJs from "./regexDetail.js"; //新增弹框配置项
import {
  getGroutingClosedFormByParentId, //主页面列表详情接口
  addGroutingCloseForm, //编辑保存
  getGroutingWarningInfo, // 审核流程
  getUserNature, //当前用户机构性质
} from "@/api/request.js";
// import { statusTypes1 } from "@/utils/config"; //配置项
export default {
  name: "GroutExceedDataClose",
  data() {
    return {
      name: "GroutExceedDataClose", //按钮配置页面代号
      rowInfo: null, //列表当前行信息

      AduitUser: null, //审核流程
      formObj: formJs.formObj, //新增编辑配置参数
      handleObj: formJs.handleObjs, //新增编辑配置参数
      handleObjs1: formJs.handleObjs1,
      handleHeight: "171px", //闭合申请单高度

      processObj: formJs.processObjs, //一级审核
      processObj1: formJs.processObjs1, //一级审核
      processHeight: "84px", //一级高度

      examineObjs: formJs.examineObjs, //二级审核
      examineObjs1: formJs.examineObjs1, //二级审核
      examineHeight: "84px", //二级高度

      levelThree: formJs.levelThrees, //三级审核
      levelThree1: formJs.levelThree1, //三级审核
      levelThreeHeight: "84px", //二级高度

      formData: {}, //新增编辑向后台传递对象
      handleData: {
        fCompanyid: "", // 施工标段id
        fId: "", // 申请单fid //为空判断为新增
        fParentid: "", // 对应的超标记录fid
        fWarningcontent: "", // 预警内容
        fReason: "", // 问题原因
        fHandleway: "", // 处理方式
        fHandleresult: "", // 处理结果
        fHandledate: "",
        fHandledates: "", // 处理日期
        fHandleusername: "", // 处理人名称
        fHandlefile: "", // 处理附件id
        fFirstcheckresult: "", // 一级审核处理结果
        fFirstcheckopinion: "", // 一级审核处理意见
        fFirstcheckusername: "", // 一级审核处理人name
        fFirstcheckdates: "", // 一级审核处理日期
        fSecondcheckresult: "", // 二级审核处理结果
        fSecondcheckopinion: "", // 二级审核处理意见
        fSecondcheckusername: "", // 二级审核处理人name
        fSecondcheckdates: "", // 二级审核处理日期
        fThirdcheckresult: "", // 三级审核处理结果
        fThirdcheckopinion: "", // 三级审核处理意见
        fThirdcheckusername: "", // 三级审核处理人name
        fThirdcheckdates: "", // 三级审核处理日期
        fFourthcheckresult: "", // 四级审核处理结果
        fFourthcheckopinion: "", // 四级审核处理意见
        fFourthcheckusername: "", // 四级审核处理人name
        fFourthcheckdates: "", // 四级审核处理日期

        aduitStatus: null, //保存状态
        userId: "", // 当前登录人id
        userName: "", // 当前登录人姓名
        recordfiles: [], // 删除文件id集合
      },
      // handleData1: formJs.handleData,
      queryCriteriaData: {}, //分页
      djDataList: formJs.djDataList,
      CloseoperationDataList: formJs.closeList,
      bhzDataList: [], //拌合站
      bhjDataList: [], //拌合机

      value2: "", //主页面日期筛选绑定值

      xlsxName: null,
      // 列表配置项
      table_config: formJs.cbtable_config,

      tableData: [], //表格列表数据列表
      tableDatas: [],

      highlightBd: true, //左侧机构树停留背景色

      treelength: false, //左侧树显示隐藏
      checked: true, //查看下级按钮
      // showName: "未选择公司",
      dialogHeight: "470px", //弹框高度
      fId: null, //点击当前列表数据fId
      checkStatus: null, //闭合状态
      // closeOperation:null, //闭合状态
      listLoading: false, //列表数据加载loading
      loadingEditDialog: false, //弹框loading
      dialogEditVisible: false, //新增弹框是否显示
      // 列表给后端传参
      getList: {
        fCompanyid: "", // 施工标段id，不为空
      },

      userInfo: {}, //登录用户

      activeNames: ["0"],
      handNum: false, //闭合申请单
      firstNum: false, //一级审核
      secondNum: false, //二级审核
      threeLevel: false, //三级审核显示
      // fourLevel: false, //四级审核显示
      btnShow: true, //保存按钮是否显示
      fSourcefileList: [],
      dialogTitle: "",
    };
  },
  components: {
    publicForm, //弹框表格
  },
  mounted() {
    this.getExamine();
    actions.onGlobalStateChange((state, prev) => {
      this.userInfo = prev.currentUser;
      // console.log("userInfo", this.userInfo);
      getUserNature({
        username: this.userInfo.loginName,
      })
        .then((res) => {
          if (res.errcode) {
            this.userInfo.companyNature = res.data.Nature;
          } else {
            this.$message.error("获取当前用户机构性质", res.msg);
          }
        })
        .catch((err) => {
          this.$message.error("获取当前用户机构性质接口报错", err.msg);
          console.log("当前用户机构性质err", err);
        });
    }, true);

    
    this.getList = {
      fCompanyid: JSON.parse(this.$route.query.data).fCompanyid, // 施工标段id，不为空
    };
  },
  methods: {
    goBack() {
      this.$router.back();
    },
    btnRole(name) {
      // 按钮权限
      var btnList = [];
      var ModuleList = JSON.parse(
        sessionStorage.getItem("GxEmbedded_ModuleList")
      );
      if (ModuleList.length > 0) {
        ModuleList.map((item) => {
          if (item.fEncode == name) {
            btnList = item.modulebuttonList;
          }
        });
        var btnStr = [];
        btnList.map((item) => {
          btnStr.push(item.fEncode);
        });
        // this.yj_view = btnStr.includes("yj_view");
      } else {
        // this.yj_view = true;
      }
    },
    // 获取审核流程
    getExamine() {
      this.AduitUser = null;
      getGroutingWarningInfo({ companyId: this.$route.query.id })
        .then((res) => {
          if (res.errcode == 0) {
            this.AduitUser = res.data.groutingwarn;
            this.yj_viewForm();
          }
        })
        .catch((error) => {
          console.log(error);
        });
    },
    // 闭合
    yj_viewForm() {
      var row = JSON.parse(this.$route.query.data);
      let AduitUserArr = [];
      let AduitUserData = "";

      AduitUserArr = this.AduitUser.fAduituser.split("-");

      this.btnShow = true; //显示保存按钮，当查看时隐藏
      this.handleObj = formJs.handleObjs; //新增编辑配置参数
      this.processObj = formJs.processObjs; //二级审核
      this.examineObjs = formJs.examineObjs; //三级审核
      this.levelThree = formJs.levelThrees; //四级审核

      this.checkStatus = row.fCheckstatus; //闭合状态

      var time = new Date();
      const y = time.getFullYear();
      const m = (time.getMonth() + 1 + "").padStart(2, "0");
      const d = (time.getDate() + "").padStart(2, "0");
      const timeYMD = `${y}-${m}-${d}`;

      this.dialogTitle = "编辑";

      AduitUserData = AduitUserArr[row.fCheckstatus];
      this.handleData = {
        fId: "", // 申请单fid //为空判断为新增
        fCompanyid: "", // 施工标段id
        fParentid: "", // 对应的超标记录fid
        fWarningcontent: "", // 预警内容
        fReason: "", // 问题原因
        fHandleway: "", // 处理方式
        fHandleresult: "", // 处理结果
        fHandledate: "",
        fHandledates: "", // 处理日期
        fHandleusername: "", // 处理人名称
        fHandlefile: "", // 处理附件id
        fFirstcheckresult: "", // 一级审核处理结果
        fFirstcheckopinion: "", // 一级审核处理意见
        fFirstcheckusername: "", // 一级审核处理人name
        fFirstcheckdates: "", // 一级审核处理日期
        fSecondcheckresult: "", // 二级审核处理结果
        fSecondcheckopinion: "", // 二级审核处理意见
        fSecondcheckusername: "", // 二级审核处理人name
        fSecondcheckdates: "", // 二级审核处理日期
        fThirdcheckresult: "", // 三级审核处理结果
        fThirdcheckopinion: "", // 三级审核处理意见
        fThirdcheckusername: "", // 三级审核处理人name
        fThirdcheckdates: "", // 三级审核处理日期

        aduitStatus: "",
        userId: "", // 当前登录人id
        userName: "", // 当前登录人姓名
        recordfiles: [], // 删除文件id集合
      };

      if (
        this.userInfo.companyNature == AduitUserData &&
        row.fCheckstatus == 0 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true; //申请单显示
        this.firstNum = false; //一级审核显示
        this.secondNum = false; //二级审核显示
        this.threeLevel = false; //三级审核显示
        this.activeNames = ["0"]; //默认展开折叠面板
        this.handleObj = this.handleObjs1;
        this.fSourcefileList = [];
      } else if (
        this.userInfo.companyNature == AduitUserData &&
        row.fCheckstatus == 1 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true; //申请单显示
        this.firstNum = true; //一级审核显示
        this.secondNum = false; //二级审核显示
        this.threeLevel = false; //三级审核显示
        this.activeNames = ["1"]; //默认展开折叠面板
        this.handleObj.map((item) => {
          //闭合单
          item.disabled = true; //闭合单禁用
          item.uploadSelect = false; //上传附件按钮是否显示
          item.rules = []; //必填项不必填
        });
        this.processObj = this.processObj1;
      } else if (
        this.userInfo.companyNature == AduitUserData &&
        row.fCheckstatus == 2 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true;
        this.firstNum = true;
        this.secondNum = true;
        this.threeLevel = false; //三级审核显示
        this.activeNames = ["2"]; //默认展开折叠面板
        this.handleObj.map((item) => {
          //闭合单
          item.disabled = true; //闭合单禁用
          item.uploadSelect = false; //上传附件按钮是否显示
          item.rules = []; //必填项不必填
        });
        this.processObj.map((item) => {
          //一级审核
          item.disabled = true; //一级审核表单禁用
          item.rules = []; //必填项不必填
        });
        this.examineObjs = this.examineObjs1;
      } else if (
        this.userInfo.companyNature == AduitUserData &&
        row.fCheckstatus == 3 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true;
        this.firstNum = true;
        this.secondNum = true;
        this.threeLevel = true; //三级审核显示
        this.activeNames = ["3"]; //默认展开折叠面板
        this.handleObj.map((item) => {
          //闭合单
          item.disabled = true; //闭合单禁用
          item.uploadSelect = false; //上传附件按钮是否显示
          item.rules = []; //必填项不必填
        });
        this.processObj.map((item) => {
          //一级审核
          item.disabled = true; //一级审核表单禁用
          item.rules = []; //必填项不必填
        });
        this.examineObjs.map((item) => {
          //二级审核
          item.disabled = true; //二级审核表单禁用
          item.rules = []; //必填项不必填
        });
        this.levelThree = this.levelThree1;
      } else if (
        this.userInfo.companyNature == AduitUserData &&
        row.fCheckstatus == 4 &&
        row.fCloseoperation == "未闭合"
      ) {
        this.handNum = true;
        this.firstNum = true;
        this.secondNum = true;
        this.threeLevel = true; //三级审核显示
        this.activeNames = ["4"]; //默认展开折叠面板
        this.handleObj.map((item) => {
          //闭合单
          item.disabled = true; //闭合单禁用
          item.uploadSelect = false; //上传附件按钮是否显示
          item.rules = []; //必填项不必填
        });
        this.processObj.map((item) => {
          //一级审核
          item.disabled = true; //一级审核表单禁用
          item.rules = []; //必填项不必填
        });
        this.examineObjs.map((item) => {
          //二级审核
          item.disabled = true; //二级审核表单禁用
          item.rules = []; //必填项不必填
        });
        this.levelThree.map((item) => {
          //三级审核
          item.disabled = true; //三级审核表单禁用
          item.rules = []; //必填项不必填
        });
      } else {
        //查看页面
        this.dialogTitle = "查看";
        this.btnShow = false;
        if (row.fCheckstatus == 0) {
          this.handNum = false; //闭合申请单显示
          this.firstNum = false; //一级审核显示
          this.secondNum = false; //二级审核显示
          this.threeLevel = false; //三级审核显示
        } else if (row.fCheckstatus == 1) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = false; //一级审核显示
          this.secondNum = false; //二级审核显示
          this.threeLevel = false; //三级审核显示
          this.activeNames = ["0"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
        } else if (row.fCheckstatus == 2) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = true; //一级审核显示
          this.secondNum = false; //二级审核显示
          this.threeLevel = false; //三级审核显示
          this.activeNames = ["0", "1"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
          this.processObj.map((item) => {
            //一级审核
            item.disabled = true; //一级审核表单禁用
            item.rules = []; //必填项不必填
          });
        } else if (row.fCheckstatus == 3) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = true; //一级审核显示
          this.secondNum = true; //二级审核显示
          this.threeLevel = false; //三级审核显示
          this.activeNames = ["0", "1", "2"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
          this.processObj.map((item) => {
            //一级审核
            item.disabled = true; //一级审核表单禁用
            item.rules = []; //必填项不必填
          });
          this.examineObjs.map((item) => {
            item.disabled = true; //二级审核表单禁用
            item.rules = []; //必填项不必填
          });
        } else if (row.fCheckstatus == 4) {
          this.handNum = true; //闭合申请单显示
          this.firstNum = true; //一级审核显示
          this.secondNum = true; //二级审核显示
          this.threeLevel = true; //三级审核显示
          this.activeNames = ["0", "1", "2", "3"]; //默认展开折叠面板
          this.handleObj.map((item) => {
            //闭合单
            item.disabled = true; //闭合单禁用
            item.uploadSelect = false; //上传附件按钮是否显示
            item.rules = []; //必填项不必填
          });
          this.processObj.map((item) => {
            //一级审核
            item.disabled = true; //一级审核表单禁用
            item.rules = []; //必填项不必填
          });
          this.examineObjs.map((item) => {
            item.disabled = true; //二级审核表单禁用
            item.rules = []; //必填项不必填
          });
          this.levelThree.map((item) => {
            item.disabled = true; //三级审核表单禁用
            item.rules = []; //必填项不必填
          });
        }
      }

      this.fId = row.fId; //闭合数据id
      var id = row.fId;

      if (id != "" && id != null) {
        this.fPhotofilelist = [];
        this.formData = this.$options.data.call(this).formData;
        // this.handleData = this.$options.data.call(this).handleData;
        getGroutingClosedFormByParentId({
          fId: id,
          fCompanyid: this.getList.fCompanyid,
        })
          .then((res) => {
            if (res.errcode == 0) {
              var that = this;
              that.loadingEditDialog = false;
              that.dialogEditVisible = true;
              that.formData = res.data.yjQmpMsGroutinginfo; //基本信息及材料用量
              var totalData = res.data.closeinfo; //闭合申请单、一级、二级、三级、四级审核
              this.handleData.fParentid = this.fId; //对应的超标记录fid

              this.handleData.fParentid = this.fId; //对应的超标记录fid
              this.handleData.aduitStatus = row.fCheckstatus;
              this.handleData.userId = this.userInfo.id; // 当前登录人id
              this.handleData.userName = this.userInfo.userName; // 当前登录人姓名

              this.handleData.fCompanyid = that.formData.fCompanyid; // 施工标段id
              this.handleData.fId = totalData.fId; //申请单fid //为空判断为新增
              this.handleData.fWarningcontent = totalData.fWarningcontent; // 预警内容
              this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id

              this.handleData.recordfiles = []; // 删除文件id集合
              if (this.checkStatus == 0) {
                this.handleData.fHandledates = timeYMD; //闭合申请单处理日期
                this.handleData.fHandleusername = this.userInfo.userName; //闭合申请单处理人名称
              } else if (this.checkStatus == 1) {
                this.handleData.fReason = totalData.fReason; // 问题原因
                this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                this.handleData.fHandledates = totalData.fHandledates; //处理日期
                this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                this.fSourcefileList = res.data.fSourcefileList; // 附件
                this.handleData.fHandleway = totalData.fHandleway; // 处理方式

                this.handleData.fFirstcheckdates = timeYMD; //一级处理日期
                this.handleData.fFirstcheckusername = this.userInfo.userName; //一级处理人名称
              } else if (this.checkStatus == 2) {
                this.handleData.fReason = totalData.fReason; // 问题原因
                this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                this.handleData.fHandledates = totalData.fHandledates; //处理日期
                this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                this.fSourcefileList = res.data.fSourcefileList; // 附件
                this.handleData.fHandleway = totalData.fHandleway; // 处理方式
                this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
                this.handleData.fFirstcheckopinion =
                  totalData.fFirstcheckopinion; // 一级审核处理意见
                this.handleData.fFirstcheckusername =
                  totalData.fFirstcheckusername; //一级审核处理人name
                this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期

                this.handleData.fSecondcheckdates = timeYMD; //二级处理日期
                this.handleData.fSecondcheckusername = this.userInfo.userName; //二级处理人名称
              } else if (this.checkStatus == 3) {
                this.handleData.fReason = totalData.fReason; // 问题原因

                this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                this.handleData.fHandledates = totalData.fHandledates; //处理日期
                this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                this.fSourcefileList = res.data.fSourcefileList; // 附件
                this.handleData.fHandleway = totalData.fHandleway; // 处理方式

                this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
                this.handleData.fFirstcheckopinion =
                  totalData.fFirstcheckopinion; // 一级审核处理意见
                this.handleData.fFirstcheckusername =
                  totalData.fFirstcheckusername; //一级审核处理人name
                this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期

                this.handleData.fSecondcheckresult =
                  totalData.fSecondcheckresult; // 二级审核处理结果
                this.handleData.fSecondcheckopinion =
                  totalData.fSecondcheckopinion; // 二级审核处理意见
                this.handleData.fSecondcheckusername =
                  totalData.fSecondcheckusername; //二级审核处理人name
                this.handleData.fSecondcheckdates = totalData.fSecondcheckdates; //二级审核处理日期

                this.handleData.fThirdcheckdates = timeYMD; //三级处理日期
                this.handleData.fThirdcheckusername = this.userInfo.userName; //三级处理人名称
              } else if (this.checkStatus == 4) {
                this.handleData.fReason = totalData.fReason; // 问题原因

                this.handleData.fHandleresult = totalData.fHandleresult; // 处理结果
                this.handleData.fHandledates = totalData.fHandledates; //处理日期
                this.handleData.fHandleusername = totalData.fHandleusername; // 处理人名称
                this.fSourcefileList = res.data.fSourcefileList; // 附件
                this.handleData.fHandlefile = totalData.fHandlefile; //处理附件id
                this.handleData.fHandleway = totalData.fHandleway; // 处理方式

                this.handleData.fFirstcheckresult = totalData.fFirstcheckresult; // 一级审核处理结果
                this.handleData.fFirstcheckopinion =
                  totalData.fFirstcheckopinion; // 一级审核处理意见
                this.handleData.fFirstcheckusername =
                  totalData.fFirstcheckusername; //一级审核处理人name
                this.handleData.fFirstcheckdates = totalData.fFirstcheckdates; //一级审核处理日期

                this.handleData.fSecondcheckresult =
                  totalData.fSecondcheckresult; // 二级审核处理结果
                this.handleData.fSecondcheckopinion =
                  totalData.fSecondcheckopinion; // 二级审核处理意见
                this.handleData.fSecondcheckusername =
                  totalData.fSecondcheckusername; //二级审核处理人name
                this.handleData.fSecondcheckdates = totalData.fSecondcheckdates; //二级审核处理日期

                this.handleData.fThirdcheckresult = totalData.fThirdcheckresult; // 三级审核处理结果
                this.handleData.fThirdcheckopinion =
                  totalData.fThirdcheckopinion; // 三级审核处理意见
                this.handleData.fThirdcheckusername =
                  totalData.fThirdcheckusername; //三级审核处理人name
                this.handleData.fThirdcheckdates = totalData.fThirdcheckdates; //三级审核处理日期
              }
            } else {
              this.$message.error("详情报错", res.msg);
              //  this.dialogEditVisible = false;
            }
          })
          .catch((error) => {
            console.log("闭合详情报错", error);
          });
      } else {
        return this.$message.error("请先选择需要查看的数据");
      }
    },

    // 判断必填
    yj_saveForm() {
      // this.handleData.fCompanyid = this.getList.fCompanyid; // 施工标段id
      if (this.checkStatus == 0) {
        //闭合申请单
        if (this.$refs.publicForm0.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      } else if (this.checkStatus == 1) {
        if (this.$refs.publicForm1.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      } else if (this.checkStatus == 2) {
        if (this.$refs.publicForm2.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      } else if (this.checkStatus == 3) {
        if (this.$refs.publicForm3.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      } else if (this.checkStatus == 4) {
        if (this.$refs.publicForm4.submitForm()) {
          this.saveForm(this.handleData);
        } else {
          console.log("error");
        }
      }
    },
    // 保存接口
    saveForm(data) {
      addGroutingCloseForm(data)
        .then((res) => {
          if (res.errcode == 0) {
            this.$router.push("/groutManage/groutExceedData");
            // this.dialogEditVisible = false;
            this.$message.success("新增成功");
          } else {
            this.$message.error(res.msg);
            console.log("接口报错");
          }
        })
        .catch((error) => {
          console.log("拌合站设置-新增）", error);
        });
    },
    delteFile(file) {
      for (let index = 0; index < this.fSourcefileList.length; index++) {
        if (file.uid == this.fSourcefileList[index].uid) {
          if (this.fSourcefileList[index].atta == undefined) {
            this.handleData.recordfiles.push({
              fId: this.fSourcefileList[index].fId,
            });
          } else {
            this.handleData.recordfiles.push({
              fId: this.fSourcefileList[index].atta.fId,
            });
          }
          this.fSourcefileList.splice(index, 1);
        }
      }
    },

    // 折叠面板
    changeCollapse(e) {
      console.log(this.activeNames, e);
    },

    
    // 重新赋值高度
    inputFocus(index, prop) {
      // console.log("inputFocus", index, prop);
      // 闭合申请单--日期
      if (prop == "fHandledates") {
        this.handleHeight = "500px";
      }
      // 一级--审核日期
      if (prop == "fFirstcheckdates") {
        this.processHeight = "400px";
      }
      //二级--审核日期
      if (prop == "fSecondcheckdates") {
        this.examineHeight = "400px";
      }
      // 三级--审核日期
      if (prop == "fThirdcheckdates") {
        this.levelThreeHeight = "400px";
      }
    },
    inputBlur(value, index, prop) {
      // console.log("inputBlur", value, index, prop);
      // 闭合申请单--日期
      if (prop == "fHandledates") {
        this.handleHeight = "171px";
      }
      // 一级--日期
      if (prop == "fFirstcheckdates") {
        this.processHeight = "84px";
      }
      // 二级--日期
      if (prop == "fSecondcheckdates") {
        this.examineHeight = "84px";
      }
      // 三级--日期
      if (prop == "fThirdcheckdates") {
        this.levelThreeHeight = "84px";
      }
    },
    visibleChange(value, index, prop) {
      // console.log("visibleChange", value, index, prop);
      // 闭合申请单--处置结果
      if (prop == "fHandleresult") {
        if (value == true) {
          this.handleHeight = "210px";
        } else {
          this.handleHeight = "171px";
          this.inputFocus(4, "fHandledates");
        }
      }
      // 一级--处置结果
      if (prop == "fFirstcheckresult") {
        if (value == true) {
          this.processHeight = "140px";
        } else {
          this.processHeight = "84px";
          this.inputFocus(0, "fFirstcheckdates");
        }
      }
      // 二级--处置结果
      if (prop == "fSecondcheckresult") {
        if (value == true) {
          this.examineHeight = "140px";
        } else {
          this.examineHeight = "84px";
          this.inputFocus(0, "fSecondcheckdates");
        }
      }
      // 三级--处置结果
      if (prop == "fThirdcheckresult") {
        if (value == true) {
          this.levelThreeHeight = "140px";
        } else {
          this.levelThreeHeight = "84px";
          this.inputFocus(0, "fThirdcheckdates");
        }
      }
    },
    // 重新赋值高度
  },
};
</script>
    
<style scoped lang='less'>
.TensionRealTime {
  height: calc(100% - 44px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.baseTitle {
  /* border: 1px solid #0c204d; */
  border-bottom: 1px solid #0c204d;
  height: 30px;
  line-height: 30px;
  position: relative;
  padding-left: 15px;
}

.baseTitle::after {
  display: block;
  content: "";
  height: 30px;
  width: 5px;
  position: absolute;
  left: 0;
  top: 0;
  background: #0c204d;
}

.TensionAndGrout_dialog .dialogBody {
  padding: 3px 20px;
  height: 98% !important;
  /* overflow-y: auto; */
}

.mechanism_dialogS /deep/ .el-table__body-wrapper {
  height: calc(100% - 84px);
  overflow-y: auto;
}

.mechanism_dialogS /deep/ .el-table__body-wrapper::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  z-index: 99999999 !important;
}

.common .block {
  bottom: 5px !important;
}
</style>